package com.eight.paper.admin.mapper;

import com.eight.paper.admin.domain.ExamPaperAnswer;
import com.eight.paper.admin.domain.model.ExamPaperAnswerBody;
import com.eight.paper.admin.domain.model.ExamineeAnswer;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * 考生答卷得分明细Mapper接口
 * 
 * @author eight
 * @date 2023-10-31
 */
public interface ExamPaperAnswerMapper 
{
    /**
     * 阅卷人修改考生答卷得分明细
     *
     * @param examPaperAnswer 考生答卷得分明细
     * @return 结果
     */
    public int updateExamPaperAnswerByMark(ExamPaperAnswer examPaperAnswer);

    /**
     * 批量新增考生答卷得分明细
     *
     * @param examPaperAnswers 考生答卷得分明细
     * @return 结果
     */
    public int insertExamPaperAnswers(@Param("examPaperAnswers")List<ExamPaperAnswerBody> examPaperAnswers);

    /**
     * 根据examineeId批量删除考生答卷得分明细
     * @param examineeId
     */
    void deleteExamPaperAnswerByExamineeId(Integer examineeId);

    /**
     * 根据明细汇总考生总成绩
     * @param examineeId
     * @return
     */
    BigDecimal sumExamineeScore(Integer examineeId);

    /**
     * 获取该试卷所有考生答题、得分、阅卷等信息
     * @param id
     * @return
     */
    List<ExamineeAnswer> selectExamineeAnswers(Integer id);

    /**
     * 获取该试卷单个考生答题、得分、阅卷等信息
     * @param id
     * @param userId
     * @return
     */
    List<ExamineeAnswer> selectExamineeAnswersByUserId(@Param("id") Integer id, @Param("userId") Long userId);
}
